package com.suyx.job.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.suyx.job.entity.GoodsInfo;
import com.suyx.job.entity.TuInfo;
import org.springframework.data.domain.Sort;
/**
 * @Auther: lanyanhua
 * @Date: 2018/10/18 0018 11:34
 * @Description:
*/
@Repository
public interface TuInfoRepository extends JpaRepository<TuInfo,Integer> ,JpaSpecificationExecutor<TuInfo> {

	List<TuInfo> findByDevice(String device,Sort sort);
	
	List<TuInfo> findByRoleId(Integer roleId,Sort sort);
	
	@Transactional
	void deleteByDeviceAndStatus(String device,String status);
	
	@Transactional
	void deleteByRoleIdAndStatus(Integer roleId,String status);
}
